/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scthtbsexos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scthtbsexos.findAll", query = "SELECT s FROM Scthtbsexos s"),
    @NamedQuery(name = "Scthtbsexos.findByScthtbsexosid", query = "SELECT s FROM Scthtbsexos s WHERE s.scthtbsexosid = :scthtbsexosid"),
    @NamedQuery(name = "Scthtbsexos.findByNombre", query = "SELECT s FROM Scthtbsexos s WHERE s.nombre = :nombre")})
public class Scthtbsexos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scthtbsexosid")
    private Integer scthtbsexosid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "nombre")
    private String nombre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scthtbsexosid")
    private Collection<Scthtbdatosgen> scthtbdatosgenCollection;

    public Scthtbsexos() {
    }

    public Scthtbsexos(Integer scthtbsexosid) {
        this.scthtbsexosid = scthtbsexosid;
    }

    public Scthtbsexos(Integer scthtbsexosid, String nombre) {
        this.scthtbsexosid = scthtbsexosid;
        this.nombre = nombre;
    }

    public Integer getScthtbsexosid() {
        return scthtbsexosid;
    }

    public void setScthtbsexosid(Integer scthtbsexosid) {
        this.scthtbsexosid = scthtbsexosid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    @XmlTransient
    public Collection<Scthtbdatosgen> getScthtbdatosgenCollection() {
        return scthtbdatosgenCollection;
    }

    public void setScthtbdatosgenCollection(Collection<Scthtbdatosgen> scthtbdatosgenCollection) {
        this.scthtbdatosgenCollection = scthtbdatosgenCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scthtbsexosid != null ? scthtbsexosid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scthtbsexos)) {
            return false;
        }
        Scthtbsexos other = (Scthtbsexos) object;
        if ((this.scthtbsexosid == null && other.scthtbsexosid != null) || (this.scthtbsexosid != null && !this.scthtbsexosid.equals(other.scthtbsexosid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scthtbsexos[ scthtbsexosid=" + scthtbsexosid + " ]";
    }
    
}
